package tx.bj12320.dao;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bj12320.model.*;
import tx.bj12320.dao.*;
import tx.bj12320.service.*;
import tx.bj12320.vo.query.*;


import static cn.org.rapid_framework.util.ObjectUtils.*;
import org.springframework.stereotype.Repository;

@Repository
public class DocInfoDao extends BaseHibernateDao<DocInfo,Long>{

	public Class getEntityClass() {
		return DocInfo.class;
	}

	public Page findPage(DocInfoQuery query) {
        // [column]为字符串拼接, {column}为使用占位符. [column]为使用字符串拼接,如username='[username]',偷懒时可以使用字符串拼接
        // [column] 为PageRequest的属性
		String sql = "select t from DocInfo t where 1=1 "
			  	+ "/~ and t.docInfoType = {docInfoType} ~/"
			  	+ "/~ and t.title = {title} ~/"
			  	+ "/~ and t.docNum = {docNum} ~/"
			  	+ "/~ and t.docSort = {docSort} ~/"
				+ "/~ and t.bwDate >= {bwDateBegin} ~/"
				+ "/~ and t.bwDate <= {bwDateEnd} ~/"
			  	+ "/~ and t.zwUnit = {zwUnit} ~/"
			  	+ "/~ and t.ngPerson = {ngPerson} ~/"
			  	+ "/~ and t.zsUnit = {zsUnit} ~/"
			  	+ "/~ and t.infoGksx = {infoGksx} ~/"
			  	+ "/~ and t.bygkyy = {bygkyy} ~/"
			  	+ "/~ and t.bmqx = {bmqx} ~/"
			  	+ "/~ and t.dmyj = {dmyj} ~/"
			  	+ "/~ and t.mj = {mj} ~/"
			  	+ "/~ and t.keyword = {keyword} ~/"
			  	+ "/~ and t.zbbm = {zbbm} ~/"
			  	+ "/~ and t.ys = {ys} ~/"
				+ "/~ and t.swrq >= {swrqBegin} ~/"
				+ "/~ and t.swrq <= {swrqEnd} ~/"
			  	+ "/~ and t.jjcd = {jjcd} ~/"
			  	+ "/~ and t.qfr = {qfr} ~/"
			  	+ "/~ and t.hqUnit = {hqUnit} ~/"
			  	+ "/~ and t.lwUnit = {lwUnit} ~/"
			  	+ "/~ and t.docName = {docName} ~/"
			  	+ "/~ and t.docFileName = {docFileName} ~/"
				+ "/~ order by [sortColumns] ~/";


		return pageQuery(sql,query);
	}


}
